package cn.acheng1314.springboot2.service.impl

import cn.acheng1314.springboot2.dto.HouseOtherPropertyDTO
import cn.acheng1314.springboot2.dto.HousePropertyDTO
import cn.acheng1314.springboot2.entity.HouseOtherProperty
import cn.acheng1314.springboot2.entity.HouseProperty
import cn.acheng1314.springboot2.mapper.HouseOtherPropertyMapper
import cn.acheng1314.springboot2.service.IHouseOtherPropertyService
import com.alibaba.fastjson.JSONObject
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
import org.springframework.stereotype.Service

/**
 * 房源服务
 * @author cheng
 * @date 2019年12月15日 23:51:40
 */
@Service
open class HouseOtherPropertyServiceImpl : ServiceImpl<HouseOtherPropertyMapper, HouseOtherProperty>(), IHouseOtherPropertyService {

    override fun saveOtherProperty(dto: HouseOtherPropertyDTO)
            = JSONObject.parseObject(JSONObject.toJSONString(dto),HouseOtherProperty::class.java).run {
        baseMapper.insert(this)
        return@run this
    }
}